#include "Classes.h"

void Object::VarAct(void (*pFunction())) {
	(*pFunction) ();
}
void Object::Act() {

}
void Object::Draw() {

}
//void Object::Draw(ITexture* Texture,position2d<s32> Position,position2d<s32> RotationPoint,f32 Rotation,vector2df Scale) {
//	// draws image to scale and rotates from specified params
//	ITexture* T = Texture;
//	rect<s32> R = rect<s32>(getX(),getY(),getX() + GetImageRect()->getWidth() * Zelda->Scale,getY() + GetImageRect()->getHeight() * Zelda->Scale);
//	SMaterial Material;
//	// store and clear the projection matrix
//	matrix4 OPM = Zelda->Driver->getTransform(ETS_PROJECTION);
//	Zelda->Driver->setTransform(ETS_PROJECTION,matrix4());
//	// store and clear the view matrix
//	matrix4 OVM = Zelda->Driver->getTransform(ETS_VIEW);
//	Zelda->Driver->setTransform(ETS_VIEW,matrix4());
//	// store corner positions
//	vector2df Corner[4];
//	Corner[0] = vector2df((f32)Position.X,(f32)Position.Y);
//	Corner[1] = vector2df((f32)Position.X + R.getWidth() * Scale.X, (f32)Position.Y);
//	Corner[2] = vector2df((f32)Position.X,(f32)Position.Y + R.getHeight() * Scale.Y);
//	Corner[3] = vector2df((f32)Position.X + R.getWidth() * Scale.X,(f32)Position.Y + R.getHeight() * Scale.Y);
//	// rotate corners
//	if(Rotation != 0.0f) {
//		for(int i = 0; i < 4; i++) {
//			Corner[i].rotateBy(Rotation,vector2df((f32)RotationPoint.X,(f32)RotationPoint.Y));
//		}
//	}
//	// store uv coordinates of the source rect
//	vector2df uvCorner[4];
//	uvCorner[0] = vector2df((f32)R.UpperLeftCorner.X,(f32)R.UpperLeftCorner.Y);
//	uvCorner[1] = vector2df((f32)R.LowerRightCorner.X,(f32)R.UpperLeftCorner.Y);
//	uvCorner[2] = vector2df((f32)R.UpperLeftCorner.X,(f32)R.LowerRightCorner.Y);
//	uvCorner[3] = vector2df((f32)R.LowerRightCorner.X,(f32)R.LowerRightCorner.Y);
//	for(int i = 0; i < 4; i++) {
//		f32 uvX = uvCorner[i].X / (f32)T->getSize().Width;
//		f32 uvY = uvCorner[i].Y / (f32)T->getSize().Height;
//		uvCorner[i] = vector2df(uvX,uvY);
//	}
//	// setup image vertices
//	S3DVertex Vertices[4];
//	u16 Indices[6] = {0,1,2,3,2,1};
//	if((Scale.X > 0.0f && Scale.Y < 0.0f) || (Scale.X < 0.0f && Scale.Y > 0.0f)) {
//		Indices[1] = 2;
//		Indices[2] = 1;
//		Indices[4] = 1;
//		Indices[5] = 2;
//	}
//	// convert pixels to world coordinates
//	f32 ScreenWidth = (f32)Zelda->Driver->getScreenSize().Width;
//	f32 ScreenHeight = (f32)Zelda->Driver->getScreenSize().Height;
//	for(int i = 0; i < 4; i++) {
//		f32 ScreenPosX = ((Corner[i].X / ScreenWidth) - 0.5f) * 2.0f;
//		f32 ScreenPosY = ((Corner[i].Y / ScreenHeight) - 0.5f) * -2.0f;
//		Vertices[i].Pos = vector3df(ScreenPosX,ScreenPosY,1);
//		Vertices[i].TCoords = uvCorner[i];
//		Vertices[i].Color = Colour;
//	}
//	Material.Lighting = false;
//	Material.ZWriteEnable = false;
//	Material.TextureLayer[0].Texture = T;
//	Material.TextureLayer[0].BilinearFilter = false; //disabled to remove aliasing on right side of image
//	if(T->hasAlpha() == true) {
//		Material.MaterialType = EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
//	} else {
//		Material.MaterialType = EMT_SOLID;
//	}
//	Zelda->Driver->setMaterial(Material);
//	Zelda->Driver->drawIndexedTriangleList(&Vertices[0],4,&Indices[0],2);
//	// restore projection and view matrices
//	Zelda->Driver->setTransform(ETS_PROJECTION,OPM);
//	Zelda->Driver->setTransform(ETS_VIEW,OVM);
//}
bool Object::IsActing() {
	return Acting;
}
rect<s32>* Object::GetImageRect() {
	return ImageRect;
}
s32 Object::getX() {
	return X;
}
s32 Object::getY() {
	return Y;
}